package model;

import java.io.Serializable;
import java.util.Observable;

public class Perspective extends Observable implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 5244524680868412169L;
	// Attributs
	private RawImage imgSource;
	private float zoom;
	private int x;
	private int y;

	// Constructeurs
	public Perspective() {
		imgSource = new RawImage("yunowork.jpg");
		setZoom(1);
		setPosition(0, 0);
	}

	public Perspective(RawImage pImgSource) {
		imgSource = pImgSource;
		setZoom(1);
		setPosition(0, 0);
	}

	// Accesseurs
	public RawImage getRawImage() {
		return imgSource;
	}

	public float getZoom() {
		return zoom;
	}

	public int getX() {
		return x;
	}

	public int getY() {
		return y;
	}

	// Mutateurs
	
	public void setZoom(float pZoom) {
		this.zoom = pZoom;
		this.notifyObservers();
	}

	public void setPosition(int pX, int pY) {
		x = pX;
		y = pY;
		this.notifyObservers();
	}

	// Methodes
	public void notifyObservers() {
		setChanged();
		super.notifyObservers();
	}
}
